/**
 * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

.cart-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  z-index: 1000;
}

.cart-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e74c3c;
  color: white;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background-color 0.3s;
}

.cart-button:hover {
  background-color: #c0392b;
  transform: scale(1.05);
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #3498db;
  color: white;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
}

.cart-popover {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 350px;
  max-height: 500px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cart-title {
  padding: 1rem;
  margin: 0;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
  color: #333;
  text-align: center;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  max-height: 300px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
  position: relative;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  display: flex;
  flex: 1;
  cursor: pointer;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.8rem;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #333;
}

.cart-item-price {
  color: #e74c3c;
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.cart-item-quantity {
  color: #666;
  font-size: 0.9rem;
}

.cart-item-remove {
  background-color: transparent;
  border: none;
  color: #999;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.3s;
}

.cart-item-remove:hover {
  color: #e74c3c;
}

.cart-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-total {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.place-order-in-cart {
  width: 100%;
  padding: 0.8rem;
  background-color: #2ecc71;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.place-order-in-cart:hover {
  background-color: #27ae60;
}

.checkout-button {
  width: 100%;
  padding: 0.8rem;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.checkout-button:hover {
  background-color: #2980b9;
}

.cart-loading,
.cart-error,
.cart-empty {
  padding: 2rem;
  text-align: center;
  color: #666;
}

.cart-error {
  color: #e74c3c;
}